package com.zhongge.model.entity;

import java.util.Date;

/**
 * @ClassName Article
 * @Description TODO 文章类
 * @Author zhongge
 * @Version 1.0
 */
public class Article {
    private Integer id;//文章id
    private String title;//文章标题
    private String content;//文章内容
    private String summary;//文章摘要
    private Integer userId;//用户ID
    private Integer categoryId;//分类ID
    private Integer viewCount;//浏览次数
    private Boolean isPublished;//发布状态
    private Date createdTime;//创建时间
    private Date updatedTime;//更新时间

    // 非数据库字段，用于页面显示
    private String username;//用户名
    private String categoryName;//分类名称

    // 构造方法
    public Article() {}

    public Article(String title, String content, Integer userId, Integer categoryId) {
        this.title = title;
        this.content = content;
        this.userId = userId;
        this.categoryId = categoryId;
    }

    // getter和setter方法
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public Integer getViewCount() {
        return viewCount;
    }

    public void setViewCount(Integer viewCount) {
        this.viewCount = viewCount;
    }

    public Boolean getIsPublished() {
        return isPublished;
    }

    public void setIsPublished(Boolean published) {
        isPublished = published;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }
}
